package com.ckzp.jfinal.system.validate;

import com.ckzp.jfinal.base.Validator;
import com.jfinal.core.Controller;

/**
 * Created by 51594 on 2024/1/10.
 */
public class SysDeptValidator extends Validator {

    /**
     * validate
     *
     * @param controller
     */
    protected void validate(Controller controller) {
        validateRequiredString("dept_id", "部门ID不能为空");
        if (!isEdit()) validateFieldExit("sys_department", "dept_id", "部门ID已存在");
        validateRequiredString("dept_name", "部门名称不能为空");
        validateNumber("sindex", "显示顺序必须为数字");
    }
}

